package com.gxa.xly2024.controller;


import com.gxa.xly2024.pojo.PurchaseXinxi;
import com.gxa.xly2024.service.impl.PurchaseXinxiServiceImpl;
import com.gxa.xly2024.vo.VO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;


@RestController
@RequestMapping("/purchaseXinxi")
public class PurchaseXinxiController {

    @Resource
    private PurchaseXinxiServiceImpl purchaseXinxiService;

    @GetMapping("/selectPurchaseXinxiById")
    public Map<String, Object> selectPurchase(Integer id) {
        return this.purchaseXinxiService.selectPurchaseXinxiById(id);
    }

    @GetMapping("/selectPurchaseXinxiByLimit")
    public Map<String, Object> selectPurchaseByLimit(VO vo) {
        return this.purchaseXinxiService.selectPurchaseXinxiByLimit(vo);
    }

    @PostMapping("/insert_PurchaseXinxi")
    public Map<String, Object> insert(@RequestBody PurchaseXinxi purchaseXinxi) {   // 接收前端传递的json对象
        return this.purchaseXinxiService.insert(purchaseXinxi);
    }

    @PostMapping("/updateById_PurchaseXinxi")
    public Map<String, Object> updateById(@RequestBody PurchaseXinxi purchaseXinxi) {   // 接收前端传递的json对象
        return this.purchaseXinxiService.updateById(purchaseXinxi);
    }
    @PostMapping("/deleteById_PurchaseXinxi")
    public Map<String, Object> deleteById(Integer id) {   // 接收前端传递的json对象
        return this.purchaseXinxiService.deleteById(id);
    }
}

